package io.day03;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

/**
 * 反序列化
 */

public class OSIDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis = new FileInputStream("person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);
        /*

            对象输入流提供了反序列化操作:
            Object readObject()

        */
        Person p = (Person) ois.readObject();
        System.out.println(p);
        ois.close();
    }
}

